<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <meta charset="UTF-8" />
    <title>Cases Detail</title>
    <link rel="stylesheet" type="text/css" media="all" href="/layui/css/layui.css"/>
    <script type="text/javascript" src="/layui/layui.all.js"></script>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/myJs.js"></script>

</head>
<body>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>基础服务详情</legend>
</fieldset>

<div class="layui-container">
    <!--6/12 布局-->
    <div class="layui-row">
        <br/><br/>
        <div class="layui-col-xs6 layui-col-xs-offset4">
            <form id="ServerForm" class="layui-form layui-form-pane">

                <!--ID-->
                <div class="layui-form-item">
                    <label class="layui-form-label">ID</label>
                    <div class="layui-input-inline">
                        <input style="height: 38px;" type="text" name="serverId" th:value="${tc.serverId}" readonly="readonly" autocomplete="off" class="layui-input layui-badge" />
                    </div>
                </div>
                <!--服务名-->
                <div class="layui-form-item">
                    <label class="layui-form-label">服务名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="vServerName" autocomplete="off" class="layui-input" th:value="${tc.vServerName}" />
                    </div>
                    <!--<div class="layui-form-mid layui-word-aux">辅助文字</div>-->
                </div>
                <!--系统类型-->
                <div class="layui-form-item">
                    <label class="layui-form-label">所属系统</label>
                    <div class="layui-input-inline">
                        <input style="height: 38px;" type="text" readonly="readonly" name="vSystem" autocomplete="off" class="layui-input" th:value="${tc.vSystem}" />
                    </div>
                </div>
                <!--git地址-->
                <div class="layui-form-item">
                    <label class="layui-form-label">git地址</label>
                    <div class="layui-input-inline">
                        <input type="text" th:value="${tc.vGitUrl}" name="vGitUrl" autocomplete="off" class="layui-input" />
                    </div>
                </div>
                <!--开发语言-->
                <div class="layui-form-item">
                    <label class="layui-form-label">开发语言</label>
                    <div class="layui-input-inline">
                        <input type="text" th:value="${tc.vLanguage}" name="vLanguage" autocomplete="off" class="layui-input" />
                    </div>
                </div>
                <!--产物-->
                <div class="layui-form-item">
                    <label class="layui-form-label">部署产物</label>
                    <div class="layui-input-inline">
                        <input type="text" name="vProduct" autocomplete="off" class="layui-input" th:value="${tc.vProduct}"/>
                    </div>
                </div>

                <!--部署方式-->
                <div class="layui-form-item">
                    <label class="layui-form-label">部署方式</label>
                    <div class="layui-input-inline">
                        <input type="text" name="vDeploy" autocomplete="off" class="layui-input" th:value="${tc.vDeployType}"/>
                    </div>
                </div>
                <!--部署方式-->
                <div class="layui-form-item">
                    <label class="layui-form-label">负责人</label>
                    <div class="layui-input-inline">
                        <input type="text" name="vLeader" autocomplete="off" class="layui-input" th:value="${tc.vLeader}"/>
                    </div>
                </div>
                <br/>
                <!--提交按钮-->
                <div class="layui-col-md-offset2">
                        <button type="reset" class="layui-btn layui-btn-warm" lay-filter="update" id="update" lay-submit="">立即提交</button>
                </div>
            </form>
            <div class="fly-footer layui-col-md-offset2">
                <br/><br/><br/><br/>
                <p><a target="_blank">我打 - 服务管理系统</a> 2018</p>
            </div>
        </div>

    </div>
</div>

<script>
    function back(){
        loadPage("/server/baseServer")
    }

    layui.use('form', function(){
        var form = layui.form;
        form.render();
        //监听提交
        form.on('submit(update)', function(data){
            var form= $("#ServerForm");
            var model= serializeObject(form);
            $.ajax({
                type: "post",
                url: "/server/updateBaseServer",
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify(model),
                dataType: "json",
                success: function(data) {
                    layer.confirm('修改成功', function(index){
                        loadPage("/server/baseServer");
                    });

                }
            })
        });
    });
</script>
</body>
</html>